#闭包demo n声明后无法改变
def make_adder(n):
    def add(x):
        return x + n
    return add
add_10 = make_adder(10)
print(add_10(20))
print(add_10(30))
print(add_10(40))